/*
 ============================================================================
 Name        : test.c
 Author      : ghl
 Version     :
 Copyright   : Your copyright notice
 Description : Hello World in C, Ansi-style
 ============================================================================
 */

#include <stdio.h>
#include <stdlib.h>

int main(void) {
//	int nums[]={1,2,3};
//	printf("%p\n",&nums);
//	printf("%p\n",nums);
//	printf("num: %d\n",sizeof(&nums));
//	printf("num: %d\n",sizeof(nums));
//	int arrays[3][3] = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 }, };
//	int i, j;
//	int (* ptr_arrays)[3] = arrays;
//	for (i = 0; i < 3; i++) {
//		for (j = 0; j < 3; j++) {
//			printf("%d\t",*(*(ptr_arrays+i)+j));
//		}
//		printf("\n");
//	}
//	printf("array  :  %p \n", *arrays);
//	printf("array[0]: %p \n", &arrays[0][0]);
	int a = 1;
	int b = 2;
	printf("a=%d\n",a);
	printf("b=%d\n",b);




	swap(&a,&b);
	printf("a=%d\n",a);
	printf("b=%d\n",b);
}

void swap(int *x, int*y) {
	int temp;
	temp = *x;
	*x = *y;
	*y = temp;
}

